package com.grasp.activity.set;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.Toast;

import com.grasp.activity.BaseFragment;
import com.grasp.activity.R;
import com.grasp.base.ActionBar;
import com.grasp.base.ActionBarOnClick;
import com.grasp.util.IntentUtil;

public class SetMainFragment extends BaseFragment {

	@Override
	protected void initView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		mView = inflater.inflate(R.layout.activity_main_setting, container,
				false);
		initActionBar();
		mView.findViewById(R.id.set_manage_device_btn).setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				IntentUtil.startActivity(getActivity(), DevicesManageActivity.class);
			}
		});
	}

	@Override
	protected void main() {
	}

	private void initActionBar() {
		ActionBar mActionBar = (ActionBar) mView
				.findViewById(R.id.set_actionbar);
		mActionBar.setActionBarOnClickListener(new ActionBarOnClick() {

			@Override
			public void rightBtnOnClick() {
				Toast.makeText(getActivity(), "rightBtnOnClick",
						Toast.LENGTH_SHORT).show();
			}

			@Override
			public void leftBtnOnClick() {
				Toast.makeText(getActivity(), "leftBtnOnClick",
						Toast.LENGTH_SHORT).show();
			}
		});
	}

}
